<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class SArticleInfo extends Model
{
    use SoftDeletes;
    public $table = "s_article_info";

    protected $fillable = [
        'title', 'tags', 'desc', 'content', 'poster', 'admin_id', 'created_at', 'updated_at'
    ];

    public function adminUser()
    {
        return $this->belongsTo('App\Models\AdminUsers', 'admin_id');
    }

    //文章列表
    static public function getList($limit=3)
    {
    	return self::select('id', 'title', 'tags', 'desc', 'poster' )->orderBy("id", "desc")->limit($limit)->get();
    }
}
